package org.example.Iterator;

import java.util.*;

public class IteratorTest {
    public static void main(String[] args) {
        List<String> l = Arrays.asList("asd", "qwe", "bbb");
        Iterator<String> iterator = l.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
            if (iterator.hasNext())
                System.out.println(iterator.next());
        }
    }

}
